package com.dangz.dans.utils.file;


/**
 * @author dangz
 * @since 2018/3/7 15:47
 */
public class TestMethod {
    public TestMethod() {
        String filePath = "http://dan365.dans.top:8089/dan_java.pdf";
        String savePath = "d:\\";
        String fileName = filePath.substring(filePath.lastIndexOf('/') + 1, filePath
                .contains("?") ? filePath.lastIndexOf('?') : filePath.length());
        try {
            DownFileInfoBean bean = new DownFileInfoBean(filePath, savePath, fileName, 5, true, null);

            /*File file = new File("D:\\apache-tomcat-9.0.1.tar.gz");
            DownFileInfoBean bean = new DownFileInfoBean(null, "e:\\",
                    "dapache-tomcat-9.0.1.tar.gz", 3, false, file);*/
            DownFileFetch fileFetch = new DownFileFetch(bean);
            fileFetch.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new TestMethod();
    }
}
